import request from '@/utils/request'
import { AxiosPromise } from 'axios'

enum Api {
  list = '/dcam/parking/list',
  delete = '/dcam/parking/delete',
  add = '/dcam/parking/add',
  edit = '/dcam/parking/edit',
  detail = '/dcam/parking/detail',
}

// 获取列表
export const dcamParkingList = (data): AxiosPromise<any> => {
  return request({
    url: Api.list,
    method: 'post',
    data,
  })
}

// 删除
export const dcamParkingDelete = (data: string) => {
  return request({
    url: Api.delete,
    method: 'post',
    data,
  })
}

// 编辑、保存
export const dcamParkingSave = (data: any) => {
  return request({
    url: data.id ? Api.edit : Api.add,
    method: 'post',
    data,
  })
}
